#define	_CRT_SECURE_NO_WARNINGS 1

#include "SeqList.h"

TestSeqList1()
{
	SeqList s;
	SeqListInit(&s);

	SeqListsPushBack(&s, 1);
	SeqListsPushBack(&s, 2);
	SeqListsPushBack(&s, 3);
	SeqListsPushBack(&s, 4);
	SeqListsPushBack(&s, 5);
	SeqListsPushBack(&s, 0);
	SeqListPrint(&s);

	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPopBack(&s);
	SeqListPrint(&s);

	SeqListsPushBack(&s, 10);
	SeqListsPushBack(&s, 20);
	SeqListPrint(&s);

	SeqListDestory(&s);
}

TestSeqList2()
{
	SeqList s;
	SeqListInit(&s);

	SeqListsPushBack(&s, 1);
	SeqListsPushBack(&s, 2);
	SeqListsPushBack(&s, 3);
	SeqListsPushBack(&s, 4);
	SeqListPrint(&s);

	SeqListPushFront(&s, 0);
	SeqListPushFront(&s, -1);
	SeqListPrint(&s);

	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPopFront(&s);
	SeqListPushFront(&s, 10);
	SeqListPushFront(&s, 20);
	SeqListPrint(&s);

}

TestSeqList3()
{
	SeqList s;
	SeqListInit(&s);

	SeqListsPushBack(&s, 1);
	SeqListsPushBack(&s, 2);
	SeqListsPushBack(&s, 3);
	SeqListsPushBack(&s, 4);
	SeqListPrint(&s);

	SeqListInsert(&s, 4, 10);
	SeqListInsert(&s, 2, 20);
	SeqListInsert(&s, 0, 30);
	SeqListPrint(&s);

	SeqListErase(&s, 6);
	SeqListErase(&s, 0);
	SeqListErase(&s, 2);
	SeqListPrint(&s);


}

TestSeqList4()
{
	SeqList s;
	SeqListInit(&s);

	SeqListsPushBack(&s, 1);
	SeqListsPushBack(&s, 2);
	SeqListsPushBack(&s, 3);
	SeqListsPushBack(&s, 4);
	SeqListPrint(&s);

	int ret = SeqListFind(&s, 4);
	printf("%d", ret);
}

int main()
{

	TestSeqList1();
	TestSeqList2();
	TestSeqList3();
	TestSeqList4();
	return 0;
}